ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Vole_JuvenileMale Class Reference

The class for juvenile male voles. More...

#include <vole_all.h>

Inheritance diagram for Vole_JuvenileMale:
Vole_Base TAnimal TALMaSSObject Vole_Male

Public Member Functions

 Vole_JuvenileMale (struct_Vole_Adult *p_aVoleStruct)
 Vole_JuvenileMale constructor. More...
 
virtual ~Vole_JuvenileMale ()
 
virtual void ReInit (struct_Vole_Adult *p_aVoleStruct)
 
virtual bool OnFarmEvent (FarmToDo event)
 JuvenileMale vole exernal event handler. More...
 
virtual void BeginStep ()
 Juvenile Male vole BeginStep. More...
 
virtual void Step ()
 Juvenile Male vole Step. More...
 
virtual void EndStep ()
 Juvenile Male vole EndStep. More...
 
virtual void OnKilled ()
 JuvenileMale vole death by external entity. More...
 
- Public Member Functions inherited from Vole_Base
 Vole_Base (struct_Vole_Adult *p_aVoleStruct)
 Constructor for Vole_Base. More...
 
virtual ~Vole_Base ()
 
virtual void Init (struct_Vole_Adult *p_aVoleStruct)
 
void st_Dying ()
 All voles end here on death. More...
 
void SetBreedingSeason (bool a_flag)
 Set Breeding Season flag. More...
 
void SetWeight (double W)
 
void Setm_Mature ()
 
void Set_BirthYear (int BirthYear)
 
void Set_MotherId (unsigned MotherIdNo)
 
void Set_FatherId (unsigned FatherIdNo)
 
void Set_NoYoungTot (int a_NoOfYoung)
 
void Set_XBorn (int a_Location_x)
 
void Set_YBorn (int a_Location_y)
 
void Set_ElemBorn (int a_Location_x, int a_Location_y)
 
void Set_VegBorn (int a_Location_x, int a_Location_y)
 
void Set_PolyRefBorn (int a_Location_x, int a_Location_y)
 
void Set_Age (int Age)
 
virtual int WhatState ()
 
bool SupplyBornLastYear ()
 Were we born this year? More...
 
bool SupplyTerritorial ()
 
int SupplyFatherId ()
 
int SupplyMotherId ()
 
bool SupplySex ()
 
int SupplyBirthYear ()
 
int SupplyTotNoYoung ()
 
int SupplyXBorn ()
 
int SupplyYBorn ()
 
int SupplyPolyRefBorn ()
 
int SupplyElemBorn ()
 
TTypesOfLandscapeElement SupplyElemType ()
 
int SupplyVegBorn ()
 
int SupplyTerrRange ()
 
double SupplyWeight ()
 
int SupplyIDNo ()
 
bool SupplyMature ()
 
int SupplyDeathCause ()
 
unsigned SupplyAge ()
 
unsigned SupplyX ()
 
unsigned SupplyY ()
 
bool SupplyInTrap ()
 
InTrapPosition SupplyTrapPosition ()
 
void SetFree ()
 
int SupplyHomoZyg ()
 
int SupplyHeteroZyg ()
 
int SupplyAllele (int locus, int allele)
 
uint32 SupplyMyAllele (int i, int j)
 
int GetGeneticFlag ()
 
int GetDirectFlag ()
 
void SetGeneticFlag ()
 
void SetDirectFlag ()
 
void UnsetGeneticFlag ()
 
void UnsetDirectFlag ()
 
GeneticMaterial SupplyGenes ()
 
virtual bool MortalityTest ()
 Do a mortality test. More...
 
void CopyMyself (VoleObject a_vole)
 Duplicates a vole. More...
 
void SetFertile (bool f)
 Set the male vole fertility. More...
 
bool GetFertile ()
 Get the male vole fertility. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

virtual void SetLocation ()
 Map location function. More...
 
virtual void FreeLocation ()
 Map location function. More...
 
virtual bool GetLocation (int px, int py)
 Map location function. More...
 
TTypeOfVoleState Dispersal (double p_OldQual, int p_Distance)
 JuvenileMale vole dispersal behaviour. More...
 
void DetermineTerritorySize ()
 
bool CanFeed ()
 
void st_JuvenileExplore (void)
 Extra movement on weaning. More...
 
void st_BecomeSubAdult (void)
 
TTypeOfVoleState st_Eval_n_Explore (void)
 JuvenileMale vole main territory assessment behaviour. More...
 
- Protected Member Functions inherited from Vole_Base
virtual void RodenticideIngestion (void)
 
double CalculateCarryingCapacity (int x, int y, int a_ddep)
 
int MoveQuality (int p_x, int p_y)
 Test a location for quality while moving. More...
 
void MoveTo (int p_Vector, int p_Distance, int iterations)
 Movement. More...
 
void DoWalking (int p_Distance, int &p_Vector, int &vx, int &vy)
 Walking. More...
 
void DoWalkingCorrect (int p_Distance, int &p_Vector, int &vx, int &vy)
 Walking where there is a danger of stepping off the world. More...
 
void Escape (int p_Vector, int p_Distance)
 Dispersal - directed movement. More...
 
void CheckTraps ()
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- Public Attributes inherited from Vole_Base
TTypeOfVoleState CurrentVState
 
Vole_Population_Managerm_OurPopulation
 
- Protected Attributes inherited from Vole_Base
int m_BirthYear
 
bool m_BornLastYear
 A flag set if the female was born the year before. More...
 
unsigned int m_MinTerrRange
 
unsigned m_MotherId
 
unsigned m_FatherId
 
int m_Death
 
int m_TerrRange
 
bool m_Sex
 
bool m_Mature
 
int m_Age
 
int m_XBorn
 
int m_YBorn
 
int m_PolyRefBorn
 
int m_ElemBorn
 
int m_VegBorn
 
int m_LifeSpan
 
double m_Weight
 
bool m_fertile
 Flag indicating the fertility state (true means fertile)
More...
 
int m_NoOfYoungTotal
 
int m_DispVector
 
bool m_Have_Territory
 
int m_Reserves
 
unsigned IDNo
 
int SimH
 
int SimW
 
GeneticMaterial m_MyGenes
 
InTrapPosition m_intrappos
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 
- Static Protected Attributes inherited from Vole_Base
static unsigned int m_MaxMaleTerritorySize = 0
 
static unsigned int m_MaxFemaleTerritorySize = 0
 
static unsigned int m_MinMaleTerritorySize = 0
 
static unsigned int m_MinFemaleTerritorySize = 0
 
static double m_MinFVoleHabQual = 0
 
static double m_MinJMVoleHabQual = 0
 
static double m_MinMVoleHabQual = 0
 
static double m_MaleTerritoryRangeSlope = 0
 
static double m_FemaleTerritoryRangeSlope = 0
 
static double m_FHabQualThreshold3
 
static double m_FHabQualThreshold2
 
static double m_FHabQualThreshold1
 
static double m_MHabQualThreshold3
 
static double m_MHabQualThreshold2
 
static double m_MHabQualThreshold1
 
static bool m_BreedingSeason = false
 

Detailed Description

The class for juvenile male voles.

Contains all the behaviour specific to the male vole. Only st_Infanticide and st_JuvenileExplore are specific to the male, other behaviours differ only in details from the female.

Constructor & Destructor Documentation

◆ Vole_JuvenileMale()

Vole_JuvenileMale::Vole_JuvenileMale ( struct_Vole_Adult p_aVoleStruct)

Vole_JuvenileMale constructor.

3313  :Vole_Base(p_aVoleStruct)
3314 {
3315  m_Age = 14;
3317  m_Sex=true;
3320 }
const int WeanedWeight
Definition: Vole_all.cpp:131
Vole_Base(struct_Vole_Adult *p_aVoleStruct)
Constructor for Vole_Base.
Definition: Vole_all.cpp:228
bool m_Sex
Definition: vole_all.h:174
double m_Weight
Definition: vole_all.h:192
unsigned int m_MinTerrRange
Definition: vole_all.h:164
int m_Age
Definition: vole_all.h:178
int m_TerrRange
Definition: vole_all.h:172
static unsigned int m_MinMaleTerritorySize
Definition: vole_all.h:220

References Vole_Base::m_Age, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.

◆ ~Vole_JuvenileMale()

Vole_JuvenileMale::~Vole_JuvenileMale ( )
virtual
3334 {
3335  // Nothing to do
3336 }

Member Function Documentation

◆ BeginStep()

void Vole_JuvenileMale::BeginStep ( void  )
virtual

Juvenile Male vole BeginStep.

The BeginStep is one of the three timestep divisions. This is called once for each vole before Step and EndStep.
The main function here is to remove voles that die before they take up CPU resources in the Step code.

Reimplemented from Vole_Base.

3109 {
3110  if (MortalityTest())
3111  {
3114  m_StepDone=true;
3115  }
3116  else
3117  {
3118  if (--m_LifeSpan<1)
3119  {
3122  m_StepDone=true;
3123  }
3124  }
3125 #ifdef __VOLEPESTICIDEON
3126  PesticideIngestion();
3127  ActOnPesticideDose();
3128 #endif
3129 }
CfgBool cfg_RecordVoleMort
@ tovmort_MLife
Definition: VolePopulationManager.h:83
@ tovmort_MBck
Definition: VolePopulationManager.h:75
bool value(void)
Definition: configurator.h:135
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
virtual bool MortalityTest()
Do a mortality test.
Definition: Vole_all.cpp:362
Vole_Population_Manager * m_OurPopulation
Definition: vole_all.h:408
int m_LifeSpan
Definition: vole_all.h:190
TTypeOfVoleState CurrentVState
Definition: vole_all.h:407
VoleSummaryOutput * m_VoleRecordMort
Definition: VolePopulationManager.h:197
void ChangeData(int a_data, int a_value)
Definition: VolePopulationManager.cpp:4048
@ tovs_MDying
Definition: vole_all.h:63

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_Base::m_LifeSpan, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MortalityTest(), tovmort_MBck, tovmort_MLife, tovs_MDying, and CfgBool::value().

◆ CanFeed()

bool Vole_JuvenileMale::CanFeed ( )
inlineprotected

◆ DetermineTerritorySize()

void Vole_JuvenileMale::DetermineTerritorySize ( )
protected

◆ Dispersal()

TTypeOfVoleState Vole_JuvenileMale::Dispersal ( double  p_OldQual,
int  p_Distance 
)
protected

JuvenileMale vole dispersal behaviour.

3238 {
3239  if (g_rand_uni() < g_extradispmort )
3240  {
3242  return tovs_MDying;
3243  }
3244  // Returns 1 for die, 0 for carry on
3245  if (m_DispVector == -1) m_DispVector = random(8); // Choose direction 0-7
3246  // Go that far in that direction (assuming it is possible to do that)
3247  int oldx = m_Location_x;
3248  int oldy = m_Location_y;
3249  MoveTo(m_DispVector, p_Distance,10);
3250  // Now we are there so what is the new quality
3251  // 1. Get the carrying capacity
3253  if ( CC <= p_OldQual )
3254  {
3255  // Don't want to move
3256  FreeLocation();
3257  m_Location_x=oldx;
3258  m_Location_y=oldy;
3259  SetLocation();
3260  }
3261  return tovs_MEvaluateExplore;
3262 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
double g_extradispmort
Definition: Vole_all.cpp:204
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
CfgInt cfg_VoleDDepConst("VOLE_DDEPCONST", CFG_CUSTOM, 4)
@ tovmort_MDisp
Definition: VolePopulationManager.h:79
int value(void)
Definition: configurator.h:98
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
double CalculateCarryingCapacity(int x, int y, int a_ddep)
Definition: Vole_all.cpp:384
int m_DispVector
Definition: vole_all.h:202
void MoveTo(int p_Vector, int p_Distance, int iterations)
Movement.
Definition: Vole_all.cpp:907
virtual void FreeLocation()
Map location function.
Definition: Vole_all.cpp:3085
virtual void SetLocation()
Map location function.
Definition: Vole_all.cpp:3076
@ tovs_MEvaluateExplore
Definition: vole_all.h:61

References Vole_Base::CalculateCarryingCapacity(), cfg_RecordVoleMort, cfg_VoleDDepConst, VoleSummaryOutput::ChangeData(), FreeLocation(), g_extradispmort, g_rand_uni, Vole_Base::m_DispVector, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MoveTo(), random(), SetLocation(), tovmort_MDisp, tovs_MDying, tovs_MEvaluateExplore, CfgInt::value(), and CfgBool::value().

Referenced by st_Eval_n_Explore().

◆ EndStep()

void Vole_JuvenileMale::EndStep ( void  )
virtual

Juvenile Male vole EndStep.

The EndStep is one of the three timestep divisions. This is called once for each vole after BeginStep and Step.
The main function here is to remove voles that have died during step and otherwise to grow if not at max weight. It also checks if the vole was killed due to human management and determines the potential territory size.

Reimplemented from Vole_Base.

Reimplemented in Vole_Male.

3182 {
3183  CheckManagement();
3185  {
3186  st_Dying();
3187  }
3188  else
3189  {
3190  m_Age++;
3193  if (m_OurLandscape->SupplyDayInYear() == 1) {
3194  m_BornLastYear = true; // must be true if alive on 1st Jan.
3195  }
3196  }
3197 }
int MinReproAgeM
Definition: Vole_all.cpp:145
const double growthperdayM
Definition: Vole_all.cpp:139
int SupplyDayInYear(void)
Definition: landscape.h:1596
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
void CheckManagement(void)
Definition: PopulationManager.cpp:1404
void st_Dying()
All voles end here on death.
Definition: Vole_all.cpp:348
bool m_BornLastYear
A flag set if the female was born the year before.
Definition: vole_all.h:162
@ tovs_MMaturation
Definition: vole_all.h:60

References TAnimal::CheckManagement(), Vole_Base::CurrentVState, growthperdayM, Vole_Base::m_Age, Vole_Base::m_BornLastYear, TAnimal::m_OurLandscape, Vole_Base::m_Weight, MinReproAgeM, Vole_Base::st_Dying(), Landscape::SupplyDayInYear(), tovs_MDying, and tovs_MMaturation.

◆ FreeLocation()

void Vole_JuvenileMale::FreeLocation ( )
inlineprotectedvirtual

Map location function.

Reimplemented from Vole_Base.

3085  {
3087  };
void ClearMapValue(unsigned x, unsigned y)
Definition: MovementMap.h:108
IDMap< TAnimal * > * m_VoleMap
Definition: VolePopulationManager.h:284

References IDMap< a_type >::ClearMapValue(), TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, and Vole_Population_Manager::m_VoleMap.

Referenced by Dispersal(), Vole_Male::Dispersal(), st_BecomeSubAdult(), Vole_Male::st_Eval_n_Explore(), Step(), and Vole_Male::Step().

◆ GetLocation()

bool Vole_JuvenileMale::GetLocation ( int  px,
int  py 
)
inlineprotectedvirtual

Map location function.

Reimplemented from Vole_Base.

3094  {
3095  if( m_OurPopulation->m_VoleMap->GetMapValue(px,py)!=NULL) return true;
3096  return false;
3097  };
a_type GetMapValue(unsigned x, unsigned y)
Definition: MovementMap.h:102

References IDMap< a_type >::GetMapValue(), Vole_Base::m_OurPopulation, and Vole_Population_Manager::m_VoleMap.

Referenced by Vole_Male::st_Eval_n_Explore().

◆ OnFarmEvent()

bool Vole_JuvenileMale::OnFarmEvent ( FarmToDo  event)
virtual

JuvenileMale vole exernal event handler.

This method evaluates external events and chooses a suitable response (in this case a probability of dying because other effects will be taken up by the evaluate and explore state.
This method is inherited by the adult male class

Reimplemented from TAnimal.

2888 {
2889  switch(event)
2890  {
2891 case sleep_all_day:
2892  break;
2893 case autumn_plough:
2896  break;
2897 case autumn_harrow:
2900  break;
2901 case autumn_roll:
2904  break;
2905 case autumn_sow:
2908  break;
2909 case winter_plough:
2912  break;
2913 case deep_ploughing:
2916  break;
2917 case spring_plough:
2920  break;
2921 case spring_harrow:
2924  break;
2925 case spring_roll:
2928  break;
2929 case spring_sow:
2932  break;
2933 case fp_npks:
2934  break;
2935 case fp_npk:
2936  break;
2937 case fp_pk:
2938  break;
2939 case fp_liquidNH3:
2940  break;
2941 case fp_slurry:
2942  break;
2944  break;
2945 case fp_manure:
2946  break;
2947 case fp_greenmanure:
2948  break;
2949 case fp_sludge:
2950  break;
2951 case fa_npk:
2952  break;
2953 case fa_pk:
2954  break;
2955 case fa_slurry:
2956  break;
2957 case fa_ammoniumsulphate:
2958  break;
2959 case fa_manure:
2960  break;
2961 case fa_greenmanure:
2962  break;
2963 case fa_sludge:
2964  break;
2965 case glyphosate:
2966  break;
2967 case herbicide_treat:
2970  break;
2971 case growth_regulator:
2972  break;
2973 case fungicide_treat:
2974  break;
2975 case insecticide_treat:
2978  break;
2979 case molluscicide:
2980  break;
2981 case row_cultivation:
2984  break;
2985 case strigling:
2988  break;
2989 case hilling_up:
2992  break;
2993 case water:
2994  break;
2995 case swathing:
2998  break;
2999 case harvest:
3002  break;
3003 case cattle_out:
3004 case cattle_out_low:
3005  break;
3006 case cut_to_hay:
3009  break;
3010 case cut_to_silage:
3013  break;
3014 case straw_chopping:
3017  break;
3018 case hay_turning:
3021  break;
3022 case hay_bailing:
3025  break;
3026 case stubble_harrowing:
3029  break;
3033  break;
3034 case burn_straw_stubble:
3037  break;
3038 case mow:
3041  break;
3042 case cut_weeds:
3045  break;
3046 case pigs_out:
3049  break;
3050 case strigling_sow:
3053  break;
3055 case trial_toxiccontrol:
3056 case trial_control:
3057  break;
3058 default:
3059  g_msg->Warn( WARN_FILE, "Vole_JuvenileMale::OnFarmEvent(): Unknown event type:",
3061  exit( 1 );
3062  }
3063  if (CurrentVState==tovs_MDying) {
3065  return true;
3066  }
3067  else
3068  return false;
3069 }
const double VoleStriglingMort
Definition: Vole_all.cpp:194
const double VoleHerbicicideMort
Definition: Vole_all.cpp:200
const double VoleSoilCultivationMort
Definition: Vole_all.cpp:196
const double VoleHarvestMort
Definition: Vole_all.cpp:192
const double VoleInsecticideMort
Definition: Vole_all.cpp:202
const double VolePigGrazingMort
Definition: Vole_all.cpp:198
@ tovmort_MFarm
Definition: VolePopulationManager.h:77
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
@ WARN_FILE
Definition: maperrormsg.h:37
@ burn_straw_stubble
Definition: treatment.h:92
@ autumn_harrow
Definition: treatment.h:37
@ swathing
Definition: treatment.h:81
@ fa_pk
Definition: treatment.h:62
@ winter_plough
Definition: treatment.h:42
@ strigling
Definition: treatment.h:77
@ fp_npks
Definition: treatment.h:48
@ glyphosate
Definition: treatment.h:102
@ fa_sludge
Definition: treatment.h:68
@ fp_liquidNH3
Definition: treatment.h:51
@ spring_roll
Definition: treatment.h:46
@ fa_greenmanure
Definition: treatment.h:67
@ spring_plough
Definition: treatment.h:44
@ molluscicide
Definition: treatment.h:75
@ hay_turning
Definition: treatment.h:88
@ autumn_roll
Definition: treatment.h:38
@ fp_manure
Definition: treatment.h:55
@ deep_ploughing
Definition: treatment.h:43
@ pigs_out
Definition: treatment.h:84
@ fa_npk
Definition: treatment.h:61
@ herbicide_treat
Definition: treatment.h:71
@ row_cultivation
Definition: treatment.h:76
@ spring_sow
Definition: treatment.h:47
@ fungicide_treat
Definition: treatment.h:73
@ fp_manganesesulphate
Definition: treatment.h:53
@ harvest
Definition: treatment.h:82
@ cut_to_silage
Definition: treatment.h:86
@ sleep_all_day
Definition: treatment.h:33
@ mow
Definition: treatment.h:93
@ fa_ammoniumsulphate
Definition: treatment.h:65
@ autumn_plough
Definition: treatment.h:34
@ straw_chopping
Definition: treatment.h:87
@ fa_manure
Definition: treatment.h:66
@ fp_greenmanure
Definition: treatment.h:56
@ fa_slurry
Definition: treatment.h:63
@ stubble_harrowing
Definition: treatment.h:90
@ hilling_up
Definition: treatment.h:79
@ growth_regulator
Definition: treatment.h:72
@ trial_control
Definition: treatment.h:98
@ insecticide_treat
Definition: treatment.h:74
@ trial_insecticidetreat
Definition: treatment.h:96
@ cattle_out_low
Definition: treatment.h:100
@ cut_to_hay
Definition: treatment.h:85
@ cut_weeds
Definition: treatment.h:94
@ fp_sludge
Definition: treatment.h:57
@ autumn_sow
Definition: treatment.h:41
@ fp_npk
Definition: treatment.h:49
@ fp_pk
Definition: treatment.h:50
@ trial_toxiccontrol
Definition: treatment.h:97
@ hay_bailing
Definition: treatment.h:89
@ spring_harrow
Definition: treatment.h:45
@ strigling_sow
Definition: treatment.h:95
@ cattle_out
Definition: treatment.h:83
@ fp_slurry
Definition: treatment.h:52
@ water
Definition: treatment.h:80
@ autumn_or_spring_plough
Definition: treatment.h:91

References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, burn_straw_stubble, cattle_out, cattle_out_low, cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_greenmanure, fa_manure, fa_npk, fa_pk, fa_sludge, fa_slurry, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_sludge, fp_slurry, fungicide_treat, g_msg, g_rand_uni, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, molluscicide, mow, pigs_out, row_cultivation, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, straw_chopping, strigling, strigling_sow, stubble_harrowing, swathing, tovmort_MFarm, tovs_MDying, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgBool::value(), VoleHarvestMort, VoleHerbicicideMort, VoleInsecticideMort, VolePigGrazingMort, VoleSoilCultivationMort, VoleStriglingMort, MapErrorMsg::Warn(), WARN_FILE, water, and winter_plough.

◆ OnKilled()

void Vole_JuvenileMale::OnKilled ( )
virtual

JuvenileMale vole death by external entity.

Response to external death event - most likely eaten by a explicitly modelled predator

Reimplemented from Vole_Base.

3303 {
3306 }
@ tovmort_MPred
Definition: VolePopulationManager.h:81

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, tovmort_MPred, tovs_MDying, and CfgBool::value().

◆ ReInit()

void Vole_JuvenileMale::ReInit ( struct_Vole_Adult p_aVoleStruct)
virtual

Reimplemented from Vole_Base.

Reimplemented in Vole_Male.

3323  {
3324  Init(p_aVoleStruct);
3325  m_Age = 14;
3327  m_Sex = true;
3330 }
virtual void Init(struct_Vole_Adult *p_aVoleStruct)
Definition: Vole_all.cpp:240

References Vole_Base::Init(), Vole_Base::m_Age, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.

◆ SetLocation()

void Vole_JuvenileMale::SetLocation ( )
inlineprotectedvirtual

Map location function.

Reimplemented from Vole_Base.

3076  {
3078  };
void SetMapValue(unsigned x, unsigned y, a_type p)
Definition: MovementMap.h:105

References TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleMap, and IDMap< a_type >::SetMapValue().

Referenced by Dispersal(), Vole_Male::Dispersal(), and Vole_Male::st_Eval_n_Explore().

◆ st_BecomeSubAdult()

void Vole_JuvenileMale::st_BecomeSubAdult ( void  )
protected
3265 {
3266  struct_Vole_Adult* av;
3267  av = new struct_Vole_Adult;
3268  av->VPM = m_OurPopulation;
3269  av->L = m_OurLandscape;
3270  if (m_MyGenes.GetDirectFlag() == 0) av->m_dflag = false; else av->m_flag = true;
3271  if (m_MyGenes.GetGeneticFlag() == 0) av->m_gflag = false; else av->m_gflag = true;
3272  av->m_flag=true; // Used to signal pesticide effect to CreateObjects
3273  // Create the new voles (50% chance of male/female)
3277  av->FatherId = m_FatherId;
3278  av->MotherId = m_MotherId;
3279  av->x = m_Location_x;
3280  av->y = m_Location_y;
3281  av->weight = m_Weight;
3282  // Do the genetics
3283  av->Genes = m_MyGenes;
3284  av->age = m_Age;
3286  // Remove the current object
3288  FreeLocation();
3289  m_CurrentStateNo = -1;
3290  m_StepDone = true;
3291 
3292 }
uint32 GetDirectFlag()
Definition: GeneticMaterial.cpp:191
uint32 GetGeneticFlag()
Definition: GeneticMaterial.cpp:187
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
unsigned m_MotherId
Definition: vole_all.h:166
GeneticMaterial m_MyGenes
Definition: vole_all.h:213
unsigned m_FatherId
Definition: vole_all.h:168
void CreateObjects(VoleObject ob_type, TAnimal *pvo, struct_Vole_Adult *as, int number)
Definition: VolePopulationManager.cpp:3455
A struct for passing data to create a new vole.
Definition: vole_all.h:123
int FatherId
Definition: vole_all.h:135
int age
Definition: vole_all.h:127
int y
Definition: vole_all.h:126
int MotherId
Definition: vole_all.h:136
GeneticMaterial Genes
Definition: vole_all.h:141
Vole_Population_Manager * VPM
Definition: vole_all.h:139
bool m_flag
Definition: vole_all.h:142
bool m_gflag
Definition: vole_all.h:143
int ElemBorn
Definition: vole_all.h:132
int PolyRefBorn
Definition: vole_all.h:131
int x
Definition: vole_all.h:125
double weight
Definition: vole_all.h:128
int VegBorn
Definition: vole_all.h:133
bool m_dflag
Definition: vole_all.h:144
Landscape * L
Definition: vole_all.h:138
@ vob_Male
Definition: vole_all.h:102

References struct_Vole_Adult::age, Vole_Population_Manager::CreateObjects(), Vole_Base::CurrentVState, struct_Vole_Adult::ElemBorn, struct_Vole_Adult::FatherId, FreeLocation(), struct_Vole_Adult::Genes, GeneticMaterial::GetDirectFlag(), GeneticMaterial::GetGeneticFlag(), struct_Vole_Adult::L, Vole_Base::m_Age, TALMaSSObject::m_CurrentStateNo, struct_Vole_Adult::m_dflag, Vole_Base::m_FatherId, struct_Vole_Adult::m_flag, struct_Vole_Adult::m_gflag, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MotherId, Vole_Base::m_MyGenes, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Base::m_Weight, struct_Vole_Adult::MotherId, struct_Vole_Adult::PolyRefBorn, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), tovs_MDying, struct_Vole_Adult::VegBorn, vob_Male, struct_Vole_Adult::VPM, struct_Vole_Adult::weight, struct_Vole_Adult::x, and struct_Vole_Adult::y.

Referenced by Step().

◆ st_Eval_n_Explore()

TTypeOfVoleState Vole_JuvenileMale::st_Eval_n_Explore ( void  )
protected

JuvenileMale vole main territory assessment behaviour.

Evaluates the quality of his habitat and does some limited exploration in the surrounding area to see if he can improve it by moving.
Returns 1 if it has died of extra dispersal mortality or starvation

3210 {
3211 #ifdef __USINGTRAPLINES
3212  CheckTraps();
3213 #endif
3216  bool NoMates = false;
3217  if (NoFemales<1) if ((g_rand_uni() < g_NoFemalesMove)) NoMates = true;
3218  //if (NoFemales<1) NoMates = true;
3219  int OldMales = 1;
3220  OldMales = m_OurPopulation->SupplyInOlderTerr(m_Location_x, m_Location_y, m_Age, m_TerrRange); // returns -1 if a male has p_x,p_y in his territory and is older than p_Age else returns the number of females present
3221  if ((Qual < m_MinJMVoleHabQual) || (OldMales<1) || NoMates)
3222  //if ((Qual < m_MinJMVoleHabQual) || (OldMales < 1))
3223  {
3224  m_DispVector = random(8);
3225  // Not quality dependent dispersal, very directed
3226  return Dispersal(-1, random(MaleMovement[0]) + 1);
3227  }
3228  else return (Dispersal(Qual, 1 + random(MaleMovement[0]) + 1));
3229 }
const unsigned MaleMovement[4]
Definition: Vole_all.cpp:179
double g_NoFemalesMove
Definition: Vole_all.cpp:205
void CheckTraps()
Definition: Vole_all.cpp:2800
static double m_MinJMVoleHabQual
Definition: vole_all.h:226
TTypeOfVoleState Dispersal(double p_OldQual, int p_Distance)
JuvenileMale vole dispersal behaviour.
Definition: Vole_all.cpp:3237
int SupplyInOlderTerr(unsigned p_x, unsigned p_y, unsigned p_Age, unsigned p_Range)
Definition: VolePopulationManager.cpp:3043
int SupplyCountFemales(unsigned p_x, unsigned p_y, unsigned p_TerrRange)
Definition: VolePopulationManager.cpp:2897

References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, Vole_Base::CheckTraps(), Dispersal(), g_NoFemalesMove, g_rand_uni, Vole_Base::m_Age, Vole_Base::m_DispVector, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinJMVoleHabQual, Vole_Base::m_OurPopulation, Vole_Base::m_TerrRange, MaleMovement, random(), Vole_Population_Manager::SupplyCountFemales(), Vole_Population_Manager::SupplyInOlderTerr(), and CfgInt::value().

Referenced by Step().

◆ st_JuvenileExplore()

void Vole_JuvenileMale::st_JuvenileExplore ( void  )
protected

Extra movement on weaning.

Cause the vole to do some exploration on maturity, just to move him away from the litter centre.
After this first day he will go into the normal Eval_n_Explore.

2874 {
2875  // Just do some movement at first
2876  MoveTo(random(8),MinMaleMovement,20);
2877 }
const unsigned MinMaleMovement
Definition: Vole_all.cpp:181

References MinMaleMovement, Vole_Base::MoveTo(), and random().

Referenced by Step().

◆ Step()

void Vole_JuvenileMale::Step ( void  )
virtual

Juvenile Male vole Step.

The Step is one of the three timestep divisions. This is called repeatedly after BeginStep and before EndStep, until all voles report that they are done with Step.

Most of the behaviours are controlled by moving voles between behavioural states in Step (for other models this is also done in BeginStep and EndStep).
When a vole is done for the day it will signal this by setting m_StepDone==true. NB that a call to one behaviour may trigger a call to another behaviour on the next call to step inside the same timestep. In this way a daily cycle of activity can be undertaken.

Reimplemented from Vole_Base.

Reimplemented in Vole_Male.

3142 {
3143  if (m_StepDone || m_CurrentStateNo == -1) return;
3144  switch (CurrentVState)
3145  {
3146  case tovs_InitialState: //initial state
3148  break;
3149  case tovs_JuvenileExploration: // Juvenile Exploration
3152  m_StepDone=true;
3153  break;
3154  case tovs_MEvaluateExplore: // Eval&Explore
3156  m_StepDone=true;
3157  break;
3158  case tovs_MMaturation:
3160  break;
3161  case tovs_MDying:
3162  FreeLocation();
3163  m_StepDone=true;
3164  break;
3165  default:
3166  m_OurLandscape->Warn("Vole_JuvenileMale::Step - unknown return error",NULL);
3167  exit(1);
3168  }
3169 }
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
void st_BecomeSubAdult(void)
Definition: Vole_all.cpp:3264
TTypeOfVoleState st_Eval_n_Explore(void)
JuvenileMale vole main territory assessment behaviour.
Definition: Vole_all.cpp:3209
void st_JuvenileExplore(void)
Extra movement on weaning.
Definition: Vole_all.cpp:2873
@ tovs_JuvenileExploration
Definition: vole_all.h:59
@ tovs_InitialState
Definition: vole_all.h:57

References Vole_Base::CurrentVState, FreeLocation(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_BecomeSubAdult(), st_Eval_n_Explore(), st_JuvenileExplore(), tovs_InitialState, tovs_JuvenileExploration, tovs_MDying, tovs_MEvaluateExplore, tovs_MMaturation, and Landscape::Warn().


The documentation for this class was generated from the following files: